import Vue from 'vue'
import VueRouter from 'vue-router'
import Recommend from '../components/recommend/recommend'
import Rank from '../components/rank/rank'
import Search from '../components/search/search'
import Singer from '../components/singer/singer'

Vue.use(VueRouter)

const routes = [
  {
    // 默认选择的路由
    path: '/',
    redirect: '/recommend'
  },
  {
    // 推荐页面
    path: '/recommend',
    name: 'recommend',
    component: Recommend
  },
  {
    // 排行页面
    path: '/rank',
    name: 'rank',
    component: Rank
  },
  {
    // 搜索页面
    path: '/search',
    name: 'search',
    component: Search
  },
  {
    // 歌手页面
    path: '/singer',
    name: 'singer',
    component: Singer
  }
]

const router = new VueRouter({
  routes
})

export default router
